package com.lixy.demo.spring4_highlight.ch1.javaconfig;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Bean;

@Configuration
public class JavaConfig {

	@Bean
	public FunctionService functionService() {
		return new FunctionService();
	}
	
	@Bean
	public UseFunctionService useFunctionService() {
		UseFunctionService useFunctionService = new UseFunctionService();
		useFunctionService.setFunctionService( functionService() );
		return useFunctionService;
	}
	
	@Bean
	public UseFunctionService useFunctionService( FunctionService functionService ) {
		UseFunctionService useFunctionService = new UseFunctionService();
		useFunctionService.setFunctionService( functionService );
		return useFunctionService;
	}
	
}
